/*
 * Platzad
 * Copyright 2008 Shayne Riley
 *
 * This file is part of Platzad.
 *
 * Platzad is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Platzad is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Platzad.  If not, see <http://www.gnu.org/licenses/>.
 *
 * To contact the authors on questions or issues regarding the license,
 * you may send an email to <shayner at gmail dot com> or write to
 * Shayne Riley / P.O. Box 1092 / McCook, NE 69001.
 */

#include "InputEntry.h"
#include <iostream>

namespace pzdControl
{

InputEntry::InputEntry(SDL_KeyboardEvent& event)
: mId(event.keysym.scancode), mState(0)
{
	if(event.state == SDL_PRESSED)
	{
		mState = 0x7FFF; // Because this is digital, return 32767 when pressed.
	}
}

InputEntry::InputEntry(SpecialId id, bool pressed)
: mId(0), mState(0)
{
	mId = static_cast<Uint16>(id);

	if(pressed)
	{
		mState = 0x7FFF; // Because this is digital, return 32767 when pressed.
	}
}

InputEntry::~InputEntry()
{
}

Uint16 InputEntry::getId()
{
	return mId;
}

Sint16 InputEntry::getState()
{
	return mState;
}

} // Namespace
